home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
map.h.z
/
map.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
2KB
|
74 lines
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
/*#ident "@(#)kern-port:sys/map.h 10.2"*/
#ident "$Revision: 3.6 $"
/*
* struct map X[] .m_size .m_addr
* --- ------------ -----------
* [0] mapsize(X) unused
* # X[] unused
* [1] map lock * mapwant sema *
* map access wait for free map space
*
* mapstart(X)-> [2] # units unit number
* : : :
* [ ] 0
*/
struct map
{
unsigned long m_size; /* number of units available */
unsigned long m_addr; /* address of first available unit */
};
#define mapstart(X) &X[2] /* start of map array */
#define mapsize(X) X[0].m_size /* number of empty slots */
/* remaining in map array */
#define mapdata(X) {(X)-3, 0} , {0, 0}
#define mapinit(X, Y, A, B) X[0].m_size = (Y)-3;\
X[1].m_size = (unsigned long) A;\
X[1].m_addr = (unsigned long) B
#define maplock(X) (*((lock_t *) X[1].m_size))
#define mapout(X) ((sema_t *) X[1].m_addr)
#define mapdefine(mapsize, nfree, start, maplock, mapout) \
{ (mapsize)-3, 0 } ,\
{ (unsigned long) maplock, (unsigned long) mapout },\
{ (nfree), (start) },\
{ 0, 0 }
extern uint malloc();
#include <sys/sema.h>
#define BITSPERBYTE 8
#define BITSPERWORD 32
struct bitmap {
sema_t m_waitsema; /* semaphore for waiters */
lock_t m_lock; /* map protections */
int m_unit0; /* value of unit[0] */
u_short m_size; /* map units available */
u_short m_lowbit; /* low-unit mark */
short m_waitcnt; /* count of waiters */
char *m_map; /* the bitmap itself */
};
extern struct bitmap sptbitmap; /* Map for system virtual space. */
extern struct bitmap ssptbitmap;/* Map for stale system virtual space. */
extern struct bitmap ssptsnap;
extern lock_t msgmplock;
extern sema_t msgmpout;
extern lock_t semmplock;
extern sema_t semmpout;